<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
</head>


<body>
	<div class="container">
		<div class="row">
			<h3>Aspirante</h3>
		</div>
		<div class="row">
			<p>
				<a href="forms/create_basic_aspirante.php" class="btn btn-success">Agregar
					Nuevo Aspirante</a>
			</p>

			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>Nombres</th>
						<th>Apellidos</th>
						<th>Email</th>
						<th>Carrera</th>
						<th>CUM</th>
						<th>Estado</th>
						<th>Accion</th>
					</tr>
				</thead>
				<tbody>
					<?php 
					//include_once($_SERVER["DOCUMENT_ROOT"]."/bolsa_trabajo/email/sent_email.php");
					include_once($_SERVER["DOCUMENT_ROOT"]."/bolsa_trabajo/dto/aspirante_dto.php");
				
					$stmt = AspiranteDTO::getAllAspirantes();

					$num = $stmt->rowCount();
				

					if($num>0){
						while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
							//exraer row
							//esto convertira $row['nombres'] a
							//solo $nombres
							extract($row);

							echo "<tr>";
							echo "<td>{$nombres}</td>";
							echo "<td>{$apellidos}</td>";
							echo "<td>{$email}</td>";
							echo "<td>{$id_carrera}</td>";
							echo "<td>{$cum}</td>";
							echo "<td>{$estado}</td>";

							// Celda de Action
							echo "<td >";
							echo "<a class='btn' href=forms/read_basic_aspirante.php?idAspirante={$id_aspirante}>Ver Info</a>";
							echo '&nbsp;';
							echo "<a class='btn btn-success' href=forms/update_basic_aspirante.php?idAspirante={$id_aspirante}&show=1>Actualizar</a>";
							echo '&nbsp;';
							echo "<a class='btn btn-danger' href=forms/desactivar_aspirante.php?idAspirante={$id_aspirante}>Desactivar</a>";
							echo '</td>';

							echo "</tr>";


						}
					}

					?>
				</tbody>
			</table>
		</div>
	</div>
	<!-- /container -->
</body>
</html>
